1. Field of the Invention
The present invention relates to a multiplexing apparatus, a multiplexing method, a program, and a recording medium. More particularly, the present invention relates to a multiplexing apparatus for multiplexing transport stream (TS) packets of an audio stream encoded by different encoding methods, a multiplexing method for use therewith, a program for use therewith, and a recording medium for use therewith.
2. Description of the Related Art
When a video stream and an audio stream are divided into TS packets and are multiplexed by using an MPEG (Moving Picture Expert Group) method, a standard model (system target decoder (STD)) is assumed as a decoder. An encoding process is performed so that a decoding process can be performed correctly in this STD.
For example, in Japanese Unexamined Patent Application Publication No. 9-261604, a technology in which an encoding apparatus shown in FIG. 1 assumes an STD model shown in FIG. 2, converts an elementary stream into TS packets, and generates an MPEG transport stream is disclosed.
The encoding apparatus of FIG. 1 includes an access unit detector 1, a pseudo-access unit calculator 2, a packetizer 3, and a scheduler 4. The STD model of FIG. 2 includes a pre-stage buffer 21, a post-stage buffer 22, and a decoder 23.
The access unit detector 1 of the encoding apparatus obtains an access unit from an elementary stream, and detects the size of the access unit and decoding time information. On the basis of the size of the pre-stage buffer 21 of FIG. 2 and the rate at which data is transferred to the pre-stage buffer 21, the pseudo-access unit calculator 2 calculates a time (input completion time) (time at which the pseudo-access unit is decoded) at which the pseudo-access unit is input to the pre-stage buffer 21 when the access unit is divided into pseudo-access units of a predetermined size. The scheduler 4 calculates the time (clock reference) at which a multiplexed stream is supplied to a decoder and the size of the packets (packet size) on the basis of the size of the pseudo-access unit and the pseudo-decoding time.
The packetizer 3 packetizes the elementary stream in accordance with the packet size, encodes the decoding time and the clock reference, and generates an MPEG transport stream. The generated MPEG transport stream is transmitted via a transmission path 5 or is recorded on a recording medium 6.
When the audio stream is to be packetized into TS packets using an MPEG method and is to be multiplexed into one transport stream, the audio stream is encoded in advance by a predetermined encoding method. Examples of the encoding method include a fixed-length encoding method and a variable-length encoding method.
Accordingly, it is considered to multiplex two audio streams encoded by different encoding methods into one transport stream.